import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  UpdateDateColumn,
  Index,
} from 'typeorm';

/**
 * 动态配置实体
 * 对应 PHP: SysConfig, Java: SysConfig
 * 完全对齐 PHP/Java 表结构
 */
@Entity('nc_sys_config')
@Index(['configKey', 'siteId'], { unique: true })
export class DynamicConfigEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'site_id', type: 'int', default: 0 })
  siteId: number;

  @Column({ name: 'config_key', type: 'varchar', length: 255 })
  configKey: string;

  @Column({ name: 'value', type: 'text', nullable: true })
  value: string;

  @Column({ name: 'status', type: 'tinyint', default: 1 })
  status: number;

  @Column({ name: 'create_time', type: 'int', default: 0 })
  createTime: number;

  @Column({ name: 'update_time', type: 'int', default: 0 })
  updateTime: number;

  @Column({ name: 'addon', type: 'varchar', length: 255, default: '' })
  addon: string;
}
